﻿using System;
using System.Collections.Generic;
//using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

            string formno = Request.QueryString["formno"];
            string irsaliyeNo = Request.QueryString["irsaliyeNo"];     

        /*
            if (formno!=null)
            {
                Response.Write("Hello frm" + formno + "<br>");
            }

            if (irsaliyeNo != null)
            {
                Response.Write("Hello Irs" + irsaliyeNo + "<br>");
            }
         */

            if ((formno != null) || (irsaliyeNo != null))
            {
                string constring = ConfigurationManager.ConnectionStrings["sConnectionString"].ConnectionString;

                using (SqlConnection con = new SqlConnection(constring))
                {
                    using (SqlCommand cmd = new SqlCommand("sp_TeknikWebService", con))
                    {
                        cmd.CommandType = CommandType.StoredProcedure;
                        cmd.Parameters.AddWithValue("@FormNo", formno);
                        cmd.Parameters.AddWithValue("@irsaliyeNo", irsaliyeNo);
                        cmd.Parameters.Add("@FormDurum", SqlDbType.VarChar, 50);
                        cmd.Parameters["@FormDurum"].Direction = ParameterDirection.Output;
                        con.Open();
                        cmd.ExecuteNonQuery();
                        con.Close();
                        Response.Write(cmd.Parameters["@FormDurum"].Value.ToString());
                    }
                }
            }
            else
            {
                Response.Write("formno veya irsaliyeNo alanları gönderiniz" + "<br>");
            }
    }
}